﻿@page "/"

@inject TrekApiClient trekClient;


<PageTitle>Home</PageTitle>

<h1>.NET Aspire Data API Builder Integration</h1>

<h3>Welcome to your demo app 🖖</h3>

@if (series is null)
{
    <p>Loading...</p>
}
else
{
    <h5>Here some StarTrek series</h5>
    <ul>
        @foreach (var s in series)
        {
            <li>@s.Name</li>
        }
    </ul>
}

@code {
    private List<Series>? series;

    protected override async Task OnInitializedAsync()
    {
        series = await trekClient.GetSeriesAsync();
    }
}